<!--- 
 *
 * Copyright (c) 2016, Lucee Association Switzerland. All rights reserved.*
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either 
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public 
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 * 
 ---><cfscript>

component extends="org.lucee.cfml.test.LuceeTestCase" skip="true" {

	function run( testResults, testBox ){
		// all your suites go here.
		describe( "LDEV-1105", function(){

			it( "check for duplicate cfid cookies after sessionRotate", function(){
				var tmpl=createURI("LDEV1105/index.cfm");

				var res=_internalRequest(template:tmpl,urls:{});
				var headers=res.headers;
				var setCookies=headers['Set-Cookie'];
				var cfidCount=0;
				loop array=setCookies item="local.c" {
					if(findNoCase("cfid=",c)) cfidCount++;
				}
				expect( cfidCount ).toBe( 1 );
			} );

		} );
	}

	private string function createURI(string calledName){
		var baseURI = "/test/#listLast(getDirectoryFromPath(getCurrenttemplatepath()),"\/")#/";
		return baseURI & "" & calledName;
	}

}
</cfscript>